home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4043 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  888 b 

  1. Path: news.compuserve.com!newsmaster
  2. From: 73700.776@compuserve.com (Walter C. Riley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to allocate two dimensional arrays using new?
  5. Date: Sat, 27 Jan 1996 13:50:51 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4edalm$fil@dub-news-svc-2.compuserve.com>
  8. References: <4doe5e$jea@nuscc.nus.sg>
  9. NNTP-Posting-Host: ad60-032.compuserve.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. eng50382@leonis.nus.sg (Zhu Qili) wrote:
  13.  
  14. >Well, when I was trying to do this in Turbo C++3.0 or Borland C++4.5:
  15.  
  16. >    int *p;
  17. >    p = new int[10][10];
  18.  
  19. >I get this:
  20. >    "Can't convert int[10] type to int type." :-(
  21.  
  22. >What kind of compiler allows me to do that? Or is there a way to get 
  23. >round the problem? Please reply me via email. Thanks!
  24.  
  25. Kenny, 
  26.  
  27. The first line below should explain the message:
  28.  
  29. int (*p)[10];
  30. p=new int[10][10];
  31.  
  32. delete [] p;
  33.  
  34.  
  35. Good luck,
  36. Walt
  37.  
  38.  
  39.  
  40.